package com.action;

import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.dsl.NonNamespaceOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/k8s")
public class NodeAction {

    @Autowired
    private KubernetesClient kubernetesClient;

    @RequestMapping("/getNodes")
    public NonNamespaceOperation getNodes(){
        NonNamespaceOperation nodes =  kubernetesClient.nodes();
        System.out.println(nodes);
        return nodes;

    }
}
